package com.group.three.sdk;

import org.springframework.stereotype.Component;

@Component
public class WXPayDomainImpl implements IWXPayDomain{

    private DomainInfo domainInfo;

    @Override
    public void report(String domain, long elapsedTimeMillis, Exception ex) {

    }

    @Override
    public DomainInfo getDomain(WXPayConfig config) {
        return getDomainInfo();
    }

    private synchronized DomainInfo getDomainInfo(){
        if(domainInfo == null){
            domainInfo = new DomainInfo("api.mch.weixin.qq.com", true);
        }
        return domainInfo;
    }
}
